<template>
	<view>
		<image src="/static/tabBar/round_add.png" class="round_add" @click="toggle"></image>
		<uni-popup ref="popup">
			<view class="popup-content">
				<view class="flex">
					<view @click="close(1)">
						<text class="iconfont icon-shucai" />
						<view>发布商品</view>
					</view>
					<view @click="close(2)">
						<text class="iconfont icon-reshaguopengren" />
						<view>发布需求</view>
					</view>
				</view>
				<image src="/static/new/close.png" class="close" @click="close(3)"></image>
			</view>
		</uni-popup>
	</view>
</template>

<script>
	export default {
		data() {
			return {};
		},
		props: {},
		computed: {},
		methods: {
			// 弹窗
			toggle() {
				this.$refs.popup.open("bottom");
			},
			close(i) {
				this.$refs.popup.close();
				if (i === 1) {
					this.$api.checkShop(() => {
						this.$refs.popup.close("bottom");
					}, "", "add_goods");
				} else if (i === 2) {
					this.navTo('/pages/xuqiu/mylist');
				};
			},
			navTo(url) {
				uni.navigateTo({
					url
				});
			},
		}
	}
</script>

<style lang="scss">
	.round_add {
		width: 120upx;
		height: 120upx;
		position: fixed;
		bottom: 0;
		right: 50%;
		z-index: 999;
		transform: translateX(50%);
	}

	.popup-content {
		height: 500upx;
		background: #fff;
		text-align: center;
		padding: 90upx 50upx;
		color: #555555;

		.iconfont {
			font-size: 90upx;
		}

		.icon-shucai {
			color: #6CCB52;
		}

		.icon-reshaguopengren {
			color: #F7A20E;
		}

		.close {
			width: 50upx;
			height: 50upx;
			margin-top: 130upx;
		}
	}
</style>
